class Events < ActiveRecord::Base

#validation for the events location has to exist
validates_presence_of :event_location

#find and show current events
def self.upcoming_events
	find(:all, :conditions => "event_date >= CURRENT_TIMESTAMP()", 
		   :order      => "event_date")
end






#format date to look like a name
def name
 event_date.to_s(:long)
end
# for the event location
def location
  event_location
end

#for the event details
def details
  event_details
end
end
